//
//  SearchController.h
//  Words2
//
//  Created by Mathieu on 2/10/06.
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//

/*This search controller is the custom NSArrayController that the search view in the interface is bound to
It efectiely filters all the user's word (across languages).

This follows the principle that, if you're looking for a word, you don't want to specify which language it's in before 
you look for it. You just look for it. Kind of like Joel on Software book "Award for the silliest user interface: Windows search"
and why Google is so successful. You don't have to spevify a search criteria! That's advance search!
And this array controller can handle that too when it needs to. */

#import <Cocoa/Cocoa.h>
@class GroupsArrayController;
@class WordArrayController;
@class DefinitionsArrayController;
@class BlobArrayController;
@class WordMO;

@interface SearchController : NSArrayController {
	IBOutlet NSSearchField *searchFieldCell;
	IBOutlet NSTabView *wordsTabView;
	IBOutlet NSTextField *addToWordsMessage;
	IBOutlet GroupsArrayController *groupArrayController;
	IBOutlet WordArrayController *wordsArrayController;
	
	IBOutlet DefinitionsArrayController *definitionArrayController;
	IBOutlet BlobArrayController *blobArrayController;
	
	// search results feedback
	IBOutlet NSTextField *searchResultMessage;
	
	WordMO *tempWord;
	
	bool isSearching;
	bool wordWasAdded;
	
//	IBOutlet LanguageArrayController *languageArrayController;
	
	//buttons
	IBOutlet NSButton *addDefButton;
	IBOutlet NSButton *delDefButton;
	IBOutlet NSButton *addBlobButon;
	IBOutlet NSButton *delBlobButton;
	IBOutlet NSButton *recordDefButton;
	IBOutlet NSButton *recordWordButton;
	IBOutlet NSButton *addWordButton;
	IBOutlet NSButton *deleteWordButton;
	IBOutlet NSButton *defineAllButton;

	IBOutlet NSButton *addToWordsButton;
	
	
	
	//word views
	IBOutlet NSTextField *largeWordView;
	IBOutlet NSTextField *smallWordView; //these need to be switched over to OUR word controller when searching.

	//record and play buttons, we need to enable and disable these
	IBOutlet NSButton *playDefRecButton;
	IBOutlet NSButton *playWordRecButton;
	IBOutlet NSButton *deleteWordRecButton;
	IBOutlet NSButton *deleteDefRecButton;
	
	IBOutlet NSTableView *groupsTableView; //we'll just hide this now. We don't want extra filters happening! That will be too confusing
	
}

- (void)registerAsObserver;
-(IBAction)addWordFromWordNotFoundView:(id)sender;
-(bool)isSearching;
-(void)setBindingsBack;
-(void)enableButtons;
-(void)disableButtons;




@end
